<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>添加商品</title>
	<hdjs/>
      <style>     
           #add{
                color:red;
                cursor:pointer;
                /*border:1px solid red;*/
                height:100px;
           }
           .bac{
               background:#F3F3F3;
           }
           .guige{
            cursor:pointer;
           }

       </style>
          <hdjs/>
       <js file="__CONTROL_TPL__/js/js.js"/>
</head>
<body>
	<form method="post" enctype="multipart/form-data" class="hd-form">
                        <div class="wrap">
			<div class="menu_list">
				<ul>
				<li>
					<a href="{|U:index}">商品列表</a>
				</li>
				<li>
					<a href="" class="action">添加商品</a>
				</li>
			                  </ul>
			</div>
                                    <div class="tab">
				<ul class="tab_menu">
					<li lab="base" class='action'>
						<a >基本信息</a>
					</li>
					<li lab="content">
						<a >详细内容</a>
					</li>
					<li lab="pic">
						<a >图片
						</a>
					</li>
				</ul>
	
                                    <div class="tab_content">	
				<!-- 基本信息 -->
                                    <div id="base" >
                                    	<table class="table1 hd-form" >
                                    		<tr>
                                    			<th class="w150">名称</th>
                                    			<td >
                                    				<input type="text" name="gname" id="" class="w300">
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">属性</th>
                                    			<td >
                                    				<label>置顶<input type="checkbox" name="flag[]" id="" value="置顶"></label>
                                    				<label>推荐<input type="checkbox" name="flag[]" id="" value="推荐"></label>
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">栏目</th>
                                    			<td >
                                    				          <list from="$data" name="d" >
                                                                         <if value="{$d.cid} eq {$arr[1]}">{$d.cname}
                                                                          <input type="hidden" name="cid" value="{$d.cid}">
                                                                         </if>
                                    				          </list>
                                    			</td>
                                    		 </tr>
                                            <tr>
                                              <th class="w150">商品属性类型</th>
                                                <td>
                                                  <table>
                                                   <list from="$attrData" name="attr">
                                                    <tr>
                                                      <th>{$attr.attr_name}</th>
                                                    <td>{$attr.html}</td>
                                                    </tr>
                                                   </list>
                                                    </table>
                                                </td>
                                            </tr>

                                             <tr>
                                              <th class="w150">商品属性规格</th>
                                                <td>
                                                  <table>
                                                    <tr align="center">
                                                      <list from="$GoodSpecData" name="spec">
                                                        <td>{$spec.attr_name}</td>
                                                      </list>
                                                      <td>库存</td>
                                                      <td>价格</td>
                                                      <td>货号</td>
                                                      <td>操作</td>
                                                    </tr>
                                                  <tbody>
                                                        <tr class="one">
                                                       <list from="$GoodSpecData" name="spec">
                                                        <td>{$spec.html}</td>
                                                      </list>
                                                      <td>
                                                        <input type="text" name="stock[]" id="">
                                                      </td>
                                                      <td>
                                                        <input type="text" name="price[]" id="">
                                                      </td>
                                                      <td>
                                                        <input type="text" name="goods_sn[]" id="">
                                                      </td>
                                                      <td align="center">
                                                         <span class="guige" onclick="addSpec(this)" >加（+）</span>
                                                      </td>
                                                    </tr>
                                                   
                                                  </tbody>
                                                
                                                    </table>
                                                </td>
                                            </tr>


                                                 <tr>
                                                      <th class="w150">品牌</th>
                                                      <td >
                                                            <select name="brandid" id="" class="w150">
                                                                  <option value="">==请选择==</option>
                                                                      <list from="$brand" name="bra" >
                                                                        <option value="{$bra.bid}">{$bra.bname}</option>
                                                                      </list>
                                                            </select>
                                                      </td>
                                                 </tr>
                                    		<!--  <tr>
                                    		 	<th class="w150">价格</th>
                                    		          <td>
                                    		          	<input type="text" name="price" id="" class="w300">
                                    		          </td>
                                    		 </tr> -->
                                    		<!--  <tr>
                                    		 	<th class="w150">库存</th>
                                    		          <td>
                                    		          	<input type="text" name="stock" id="" class="w300">
                                    		          </td>
                                    		 </tr> -->
                                    		  <tr>
                                    		 	<th class="w150">关键字</th>
                                    		          <td>
                                    		          	<input type="text" name="keywords" id="" class="w300">
                                    		          </td>
                                    		 </tr>
                                    		   <tr>
                                    		 	<th class="w150">描述</th>
                                    		          <td>
                                    		          	<textarea name="description" id="" cols="30" rows="10" class="w400 h100"></textarea>
                                    		          </td>
                                    		 </tr>
                                    	</table>
                                    </div>
                                    <!-- 详细信息 -->
                                        <div id="content" >
                                    	<table class="table1" >
                                    		<tr>
                                    			<th class="w150">内容</th>
                                    			<td >
                                    				<ueditor name="body"/>
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">服务</th>
                                    			<td >
                                    				<input type="text" name="service" id="" class="w300">
                                    			</td>
                                    		</tr>
                                    		<tr>
                                    			<th class="w150">查看次数</th>
                                    			<td >
                                    				<input type="text" name="click" id="" class="w300">
                                    			</td>
                                    		</tr>
                                                            <tr>
                                                                  <th class="w150">更新时间</th>
                                                                  <td >
                                                                        <input type="text" name="addtime" id="addtime" class="w300" readonly="readonly"   >
                                                                  </td>
                                                            </tr>
                                    	</table>
                                       </div>
                                    <div id="pic">
                                    	<table class="table1">
                                    		<tr>
                                    			<th class="w150">首页图</th>
                                    			<td ><input type="file" name="index_pic" id=""  ></td>
                                    		</tr>
                                    		<tr>
                                    			<th>列表图</th>
                                    			<td>
                                    				<input type="file" name="list_pic" id="">
                                    			</td>
                                    		</tr>
                                                            <tr>
                                                                  <th>内容图</th>
                                                                  <td id="td" >
                                                                        <div class="content">
                                                                              <input type="file" name="pic[]" id="" class="w150">
                                                                           <span id="add" >增加（+）</span>
                                                                        </div>
                                                                  </td>
                                                            </tr>
                                    	</table>
                                    </div>
                  	</div>
                  	</div>
                     
		<!-- 底部确定按钮 -->
		<div class="position-bottom">
			<input type="submit" value="确定" class="hd-success">
		</div>
	</form>
</body>
<script>
      $("#addtime").calendar({format: 'yyyy/MM/dd HH:mm:ss'});
      var input="<div style='margin-top:10px' class='content'><input type='file' name='pic[]' id= class='w150' class='w150' ><span style='color:red;margin-left:5px;cursor:pointer'  class='del1'>减少（-）<span></div>";
      $("#add").click(function(){
            $("#td").append(input);
      })
      $(".del1").live("click",function(){
            $(this).parent().remove();
      })
      $(".content").live("hover",function(){
            $(this).addClass('bac').siblings('.content').removeClass('bac');
      })
</script>
</html>








